package com.lsh.payment.core.model.payenum;

import lombok.Getter;

/**
 * Project Name: lsh-payment
 *
 * @author peter
 * @date 19/4/22
 * 北京链商电子商务有限公司
 * Package
 * desc:
 */
@Getter
public enum DownloadBill {
    /**
     *
     */
    WXH5("WXH5", BillTradeType.JSAPI.getCode(), PayChannel.WXPAY.getName()),
    WXAPP("WXAPP", BillTradeType.APP.getCode(), PayChannel.WXPAY.getName()),
    ALI("ALI", 0, PayChannel.ALIPAY.getName()),
    WXQF("WXQF", BillTradeType.WXNATIVE.getCode(), PayChannel.QFPAY.getName()),
    ALIQF("ALIQF", BillTradeType.ALINATIVE.getCode(), PayChannel.QFPAY.getName()),
    LAKALA("LAKALA", 0, PayChannel.LKLPAY.getName()),
    ALLIN("ALLIN", BillTradeType.ALINATIVE.getCode(), PayChannel.ALLINPAY.getName()),
    CMPAY("CMPAY", BillTradeType.WXNATIVE.getCode(), PayChannel.CMPAY.getName()),
    PURSE_PAY("PURSE_PAY", 0, PayChannel.PURSE_PRE_PAY.getName());

    private String jopKey;
    private int billType;
    private String payChannelName;

    DownloadBill(String jopKey, int billType, String payChannelName) {
        this.jopKey = jopKey;
        this.billType = billType;
        this.payChannelName = payChannelName;
    }

    public static DownloadBill getDownloadBill(String jopKey) {
        for (DownloadBill bill : DownloadBill.values()) {
            if (bill.getJopKey().equals(jopKey)) {
                return bill;
            }
        }

        return null;
    }

}
